<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var r1 = "admin";
        var r2 = "123456";
        //接受用户输入的账号
        var r3;
        //接受用户输入的密码
        var r4;
        var flag = true;
        while (flag) {
            do {
            r3 = prompt("请输入用户名：");
            r4 = prompt("请输入密码：");
            if (r1 === r3 && r2 === r4) {
                alert("登陆成功");
                flag = false;
            }else{
                alert("账号或密码错误请重新输入");
            }
        } while (flag);
        }
        
    </script>
</body>
</html>